using System;
using System.Collections.Generic;
using System.Xml;
using System.Collections.ObjectModel;

namespace planning
{
	public abstract class Ressource : ObservableObject
	{
		// ----- ATTRIBUTS -----


		// ----- CONSTRUCTEURS -----
		public Ressource()
		{
			// Start of user code for default constructor
			// End of user code for default constructor
		}

		// ----- ACCESSEURS -----



		private static Dictionary<string, Ressource> references = new Dictionary<string, Ressource>();

		public static Ressource fromXml(XmlNode node)
		{

			Type elementType = Type.GetType("planning." + node.Name);
			if(!typeof(Ressource).IsAssignableFrom(elementType))
				throw new InvalidOperationException();

			Ressource ressource = (Ressource) elementType.GetMethod("fromXml").Invoke(null, new object[] { node });
			return ressource;
		}

		public virtual XmlElement toXml(XmlDocument document)
		{
			// Start of user code for toXml
			// End of user code for toXml
		}


	}

}
